package com.kuang.service;

import com.kuang.dao.BookMapper;
import com.kuang.pojo.BOOKS;

import java.util.List;

public class bookServiceImpl implements bookService {
//    业务层调dao层
    private BookMapper bookMapper;
//设置set方法，注入spring
    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }


    public int addbook(BOOKS books) {
        return bookMapper.addbook(books);
    }

    public int deletebook(int id) {
        return bookMapper.deletebook(id);
    }

    public int updatebook(BOOKS books) {
        System.out.println("bookServiceImpl:updateBook=>"+books);
        return bookMapper.updatebook(books);
    }

    public BOOKS querybook(int id) {
        return bookMapper.querybook(id);
    }

    public List<BOOKS> queryAllbook() {
        return bookMapper.queryAllbook();
    }

    public BOOKS queryBookByName(String bookName) {
        return bookMapper.queryBookByName(bookName);
    }


}
